package com.leedsoft.spittr.model;

import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * Created by leeds on 2017/11/7.
 */
public class User {
    @NotNull(message = "年龄不可为空")
    @Range(min = 10, max = 19, message = "年龄应该介于10到19之间")
    private Integer age;
    @NotBlank
    @Pattern(regexp = "[1-9]\\d{3}", message = "电话号码错误")
    private String name;

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
